package com.ecfront.test.dao;

import java.util.Iterator;
import java.util.List;
import com.ecfront.dao.LinkDAO;
import com.ecfront.pojo.Link;
import junit.framework.TestCase;

public class testLink extends TestCase {
	private static final LinkDAO linkDao = (LinkDAO)SpringUtilTest.getBean("LinkDAO");
	//保存测试�������
	public void testSave(){
		Link link = new Link();
		link.setImgUrl("link.jpg");
		link.setLevel(0);
		link.setName("链接1");
		link.setWordUrl("http://12132.com");
		
		linkDao.save(link);
	}
	//删除测试
	public void testDel(){
		Link link = new Link();
		link.setId(2);
		
		linkDao.delete(link);
	}
	//属性测试���Բ���
	public void testFindAll(){
		List list = linkDao.findAll();
		for(Iterator iter = list.iterator();iter.hasNext();){
			Link link = (Link)iter.next();
			System.out.println(link.getImgUrl());
		}
	}
}
